Repository navigation
fix(id/world_net): refuse a malformed compiled reply instead of defaulting its fields (#6620) - #6718
Merged
Merged
Conversation
…lting its fields (#6620)
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 27 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6620
Summary
WorldClient::compileread the host'scompiledreply withunwrap_or_default()on every field — a missing or mistypedmodule_hash,sequence, ordiagnosticssilently became("", 0, "")andOk, soid world compileprinted an empty hash with exit 0 andid world applycounted the step applied.compile()now routes through a factoredparse_compile_reply(mirroringparse_create_world_reply, landed for sibling #6632) that:compiledframe (refusal path unchanged, default "host refused to compile");module_hashanddiagnosticsto be present strings andsequencea present unsigned integer, failing with errors naming the field ("host sent no module hash in compiled reply", "host sent a malformed compiled reply:sequenceis not an unsigned integer", …);0and empty diagnostics.Phase 1 of design #6669 (a reply is not its defaults); error wording follows the #6632 precedent in the same file.
Evidence
compile_reply_requires_all_fieldsdrives the parser with the issue's shapes: well-formed control returned unchanged; genuinesequence: 0+ empty diagnostics control; each field missing → error naming the field; bare{"type":"compiled"}→ error; mistyped fields (number-as-hash, string/negative sequence, number diagnostics, null hash) → error; refusal frames surface the host's message and the default refusal text.cargo test --lib compile_reply_requires_all_fields(laptop, pkgs/id): passed. Fullcargo test --lib world_net(laptop): 29 passed / 0 failed.b7d16d10:world_net.rs:772-776still carried the threeunwrap_or_default()reads while every sibling parser in the file refuses the same shapes.Merge Danger
Door: two-way — client-side validation only, single-commit revert.
Blast Radius:
WorldClient::compilecallers only (id world compile,id world apply's InstallModule step). Well-formed hosts (the typed server always sends all three fields) are unaffected; only missing/garbledcompiledreplies change, from silent("", 0, "")success to an explicit error naming the field.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.